//
//  PayViewController.m
//  MM
//
//  Created by 郑渊文 on 6/2/15.
//  Copyright (c) 2015 王晨辉. All rights reserved.
//

#import "PayViewController.h"

@interface PayViewController ()
{
    UIButton *backBtn;
}

@end

@implementation PayViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initSubViews];
    self.navigationItem.title = @"课程详情";
    [self.navigationController.navigationBar setTranslucent:NO];//设置navigationbar的半透明
    [self.navigationController.navigationBar setBarTintColor:[GetFileModel colorWithHexString:@"#34bd81" alpha:1]];
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];

    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)initSubViews
{
    
    //自定义左右按钮
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [button setBackgroundImage:[UIImage imageNamed:@"_0000_返回.png"]
     
                      forState:UIControlStateNormal];
    
    [button addTarget:self action:@selector(back)
     
     forControlEvents:UIControlEventTouchUpInside];
    
    button.frame = CGRectMake(0, 0, 20, 15);
    
    
    
    UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    
    
    self.navigationItem.leftBarButtonItem = menuButton;
    
    UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    bgView.backgroundColor = UIColorWithRGBA(240, 239, 245, 1);
    [self.view addSubview:bgView];
    
    UILabel *priceLable = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, SCREEN_WIDTH-20, 130)];
    priceLable.backgroundColor = [UIColor whiteColor];
    priceLable.textAlignment = NSTextAlignmentCenter;
    priceLable.text = @"400.00元";
    priceLable.font = [UIFont systemFontOfSize:30];
    priceLable.textColor = [UIColor redColor];
    [bgView addSubview:priceLable];
    
    
    UIView *payView = [[UIView alloc]initWithFrame:CGRectMake(0,150, SCREEN_WIDTH, 300)];
    payView.backgroundColor = [UIColor redColor];
    [bgView addSubview:payView];
    
    
    UIButton *payBtn = [[UIButton alloc]initWithFrame:CGRectMake(-10, SCREEN_HEIGHT-110, SCREEN_WIDTH+20, 50)];
    [payBtn setBackgroundImage:[UIImage imageNamed:@"确认支付"] forState:UIControlStateNormal];
    [payBtn addTarget:self action:@selector(surePay) forControlEvents:UIControlEventTouchUpInside];
    payBtn.backgroundColor = UIColorWithRGBA(227, 90,92, 1);
    [bgView addSubview:payBtn];
    
}

-(void)surePay
{
    
}

-(void)back
{
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
